#include <bits/stdc++.h>
#define ll long long
#define mem(f, x) memset(f, x, sizeof(f))
#define pii pair<int, int>
#define fi first
#define se second
#define mk(x, y) make_pair(x, y)
#define pk push_back
using namespace std;
const int M = 205;
const int N = 205;
const int MOD = 1e9 + 7;
const ll INF = 1e18 + 50;
int m, n;
bool mp[N][N];
int num[3];
int ans1, ans2;
void dfs(int pos, int cnt)
{
    if (cnt == 3)
    {
        int a = num[0], b = num[1], c = num[2];
        if (mp[a][b] && mp[b][c])
        {
            ans2++;
            if (mp[a][c])
                ans1++;
        }
        if (mp[b][c] && mp[c][a])
        {
            ans2++;
            if (mp[a][b])
                ans1++;
        }
        if (mp[c][a] && mp[a][b])
        {
            ans2++;
            if (mp[b][c])
                ans1++;
        }
        return;
    }
    for (int i = pos + 1; i <= n; i++)
    {
        num[cnt] = i;
        dfs(i, cnt + 1);
    }
}
int gcd(int x, int y)
{
    return !y ? x : gcd(y, x % y);
}
int main()
{
    int t;
    scanf("%d", &t);
    while (t--)
    {
        mem(mp, 0);
        scanf("%d %d", &n, &m);
        int x, y;
        for (int i = 0; i < m; i++)
        {
            scanf("%d %d", &x, &y);
            mp[x][y] = mp[y][x] = 1;
        }
        ans1 = ans2 = 0;
        dfs(0, 0);
        int gd = gcd(ans2, ans1);
        ans1 /= gd, ans2 /= gd;
        printf("%d/%d\n", ans1, ans2);
    }
    return 0;
}